13 Jan 2025
Utrecht University Logo
Welcome to my advanced Quarto presentation!
I am currently reading a very interesting book by Deborah (Mayo 2018)
library(renv)
renv::init()
library(tidyverse)
###this is the code for a Lincoln-Peterson estimator:
set.seed(1337)
# Set a population size
popSize = 1000
# simulate a population and three samples
A = rbinom(popSize,1,prob=0.5)
B = rbinom(popSize,1,prob=0.4)
freq = 1
data = cbind(A,B,freq)
observed = nrow(data[rowSums(data[,1:2])!=0,])
m00 = popSize - observed
m00[1] 305
cont_2S = aggregate(freq~A+B,data=data,FUN=sum)
###LP-estimator for m00
cont_2S[cont_2S$A==1&cont_2S$B==0,"freq"]*
cont_2S[cont_2S$A==0&cont_2S$B==1,"freq"]/
cont_2S[cont_2S$A==1&cont_2S$B==1,"freq"][1] 285.3786
R version 4.4.1 (2024-06-14)
Platform: aarch64-apple-darwin20
Running under: macOS 15.2
Matrix products: default
BLAS: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRblas.0.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.4-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.12.0
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
time zone: Europe/Berlin
tzcode source: internal
attached base packages:
[1] stats graphics grDevices datasets utils methods base
other attached packages:
[1] lubridate_1.9.3 forcats_1.0.0 stringr_1.5.1 dplyr_1.1.4
[5] purrr_1.0.2 readr_2.1.5 tidyr_1.3.1 tibble_3.2.1
[9] tidyverse_2.0.0 plotly_4.10.4 ggplot2_3.5.1 DT_0.33
loaded via a namespace (and not attached):
[1] sass_0.4.9 utf8_1.2.4 generics_0.1.3 renv_1.0.11
[5] stringi_1.8.4 hms_1.1.3 digest_0.6.37 magrittr_2.0.3
[9] timechange_0.3.0 evaluate_1.0.1 grid_4.4.1 fastmap_1.2.0
[13] jsonlite_1.8.9 httr_1.4.7 fansi_1.0.6 crosstalk_1.2.1
[17] viridisLite_0.4.2 scales_1.3.0 lazyeval_0.2.2 jquerylib_0.1.4
[21] cli_3.6.3 rlang_1.1.4 munsell_0.5.1 withr_3.0.2
[25] cachem_1.1.0 yaml_2.3.10 tools_4.4.1 tzdb_0.4.0
[29] colorspace_2.1-1 vctrs_0.6.5 R6_2.5.1 lifecycle_1.0.4
[33] htmlwidgets_1.6.4 pkgconfig_2.0.3 pillar_1.9.0 bslib_0.8.0
[37] gtable_0.3.6 data.table_1.16.2 glue_1.8.0 xfun_0.49
[41] tidyselect_1.2.1 rstudioapi_0.17.1 knitr_1.49 farver_2.1.2
[45] htmltools_0.5.8.1 rmarkdown_2.29 labeling_0.4.3 compiler_4.4.1